<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul id="ul"></ul>

    <script>
        let now = Date.now();
        const total = 100000;
        const ul = document.getElementById("ul");

        for(let i = 0; i < total; i++){
            const li = document.createElement("li");
            li.innerText = ~~(Math.random() * total);
            ul.appendChild(li);
        }
        console.log(Date.now() - now);
        setTimeout(() => {
            console.log(Date.now() - now);
        });
    </script>
</body>
</html>